<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Gloze: Main Page</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />



</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Gloze
   &#160;<span id="projectnumber">1.01-beta2</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li class="current"><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Packages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">Gloze Documentation</div>  </div>
</div>
<div class="contents">
<div class="textblock"><p><b>gloze</b> : to make explanatory notes or glosses on a text</p>
<p><a class="el" href="classcom_1_1hp_1_1gloze_1_1_gloze.html">Gloze</a> is a tool for mapping between XML and RDF; describing the <em>content</em> of an XML document. It may be used to:</p>
<ul>
<li>generate an RDF description of an XML document (using the XML schema)</li>
<li>generate an XML document from its RDF description (using the XML schema)</li>
<li>generate an OWL ontology from the XML schema.</li>
</ul>
<p><a class="el" href="classcom_1_1hp_1_1gloze_1_1_gloze.html">Gloze</a> provides an alternative to hand-crafted XSLTs for translating XML into RDF/XML. Furthermore, the <a class="el" href="classcom_1_1hp_1_1gloze_1_1_gloze.html">Gloze</a> mapping is reversible so that an XML document may be mapped into RDF then back into XML with minimal loss of information. Key to this mapping is the XML schema, which provides additional type and compositional information not available in the source XML.</p>
<p>The concept behind <a class="el" href="classcom_1_1hp_1_1gloze_1_1_gloze.html">Gloze</a> is to make this mapping as unsurprising as possible, while avoiding the introduction of new vocabulary. Put simply, XML schema types, both simple and complex, map to OWL classes, while elements and their attributes map to properties. Any given <em>instance</em> of an XML attribute or element maps to an RDF statement. The content of the element or attribute is the object of the statement, which may be a literal or an RDF resource with its own properties.</p>
<p>The translation of schema into OWL is simplified by the fact that OWL uses the majority of XML schemas predefined data-types. The RDF semantics recommendation identifies a subset of these data-types suitable for use in RDF typed literals. Exceptions include: anySimpleType, duration, ENTITY, ENTITIES, ID, IDREF, IDREFS, NMTOKENS, NOTATION, QName. The remaining data-types are translated as-is. The tree structure of the XML translates almost directly into RDF. Intermediate nodes are bnodes unless they represent the document element (with the document base as its URI) or if they have an xs:ID identifier.</p>
<p>Qualified attributes and elements are declared in the target namespace of the schema, or in the default namespace if unqualified. All types are defined in the target namespace of the schema, or in the case of a no-namespace schema we must give a default namespace. An element, attribute or type is unqualified if no target namespace is defined, or if it is defined locally and its form is unqualified. Unqualified attributes/elements are not defined in the target namespace, but the translation requires an absolute URI; an additional default namespace must be supplied. In xml schema, attributes and elements have their own symbol spaces, distinct from each other and the types. If there is a namespace clash between these symbol spaces, it is advisable to introduce extra symbolic prefixes, appended to the target namespace, to keep them distinct. We have to be careful to distinguish the name of the type from the identity of the schema component that defines it. If we need to refer to the schema component, to use its additional definitional machinery, we may use its id (relative to the schema base), or a schema component identifier.</p>
<p>The names of locally defined attributes &amp; elements can be recycled in different type definitions (different particles), each time with a different type. From the perspective of XML schema they are different properties, but rather than trying to construct an elaborate and obscure naming scheme that keeps them apart, we take the view that these are different uses of the same property. This means that a property may refer to a data-type in one type, but to an object in another. There are therefore no guarantees that the translation will be in OWL DL; a given property could be both an object and a data-type property. If OWL DL is a desirable outcome then it is up to the schema author to come up with a clean design (union types raise similar design challenges). We can't assume that the schema as a whole prescribes all uses of that name because it can always be included in another unidentified schema that recycles the name again. We assume that globally defined attributes &amp; elements are not recycled in this way (name clashes notwithstanding); and that all occurrences conform to this global declaration. This enables us to derive property ranges directly from global attribute &amp; element declarations.</p>
<p>Where the lexical ordering of the children is significant, this is captured in an RDF sequence of reified statements. This is simply overlaid over the existing tree structure, so you can take it or leave it. Queries to the RDF that aren't interested in ordering can simply ignore it. As for OWL modelling, sequencing is regarded as a data-structuring issue rather than one of ontological significance.</p>
<p>Element <em>groups</em> and <em>attribute</em> <em>groups</em> are treated as syntactic sugar rather than fully fledges classes, so are flattened out of the OWL mapping. As indeed are <em>sequence</em>, <em>choice</em> and <em>all</em> compositors which are only used to calculate the cardinalities of their respective content. They don't add structure.</p>
<p>There are, of course, a few wrinkles caused by mixed and nillable content, and we will see how the non-recommended datatypes map into RDF. These issues are covered in the relevant documentation. </p>
</div></div>


<hr class="footer"/><address class="footer"><small>
Generated on Tue Nov 15 2011 22:13:50 for Gloze by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
